package homework;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class Test2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("text.txt");
        BufferedInputStream bis = new BufferedInputStream(fis);
        FileOutputStream fos = new FileOutputStream("text_cp1.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        byte[] data = new byte[1024*10];
        int d;
        while ( (d =bis.read(data))!= -1){
            bos.write(data,0,d);
            System.out.println("复制完毕！");
        }
        bos.close();
        bis.close();
    }
}
